<template>
    <div class="company-log-page">
        <el-card shadow="never" v-loading="loading">
            <div class="title">企业帐号维护日志</div>
            <div class="time">{{ data.created_at | formatTime }} {{ name }}</div>
            <div class="content" v-html="data.comment"></div>
        </el-card>
        <div class="text-center mt-4">
            <el-button @click="$router.back()">返 回</el-button>
        </div>
    </div>
</template>

<script>

export default {
    components: {
    },
    data() {
        return {
            loading: false,
            data: {},
            name: '',
        };
    },
    methods: {
        async fetchData() {
            const id = this.$route.params.id;
            if (!id) return;
            this.loading = true;
            this.data = await API.get(`company/log/${id}`);
            this.loading = false;
        },
    },
    mounted() {
        this.fetchData();
        this.name = this.$route.query.name;
    },
};
</script>

<style lang="scss">
.company-log-page {
    .el-card {
        padding: 37px 100px 30px 100px;
    }

    .title {
        font-size: 30px;
    }

    .time {
        margin: 12px 0 26px 0;
        font-size: 12px;
        color: rgb(192, 196, 204);
    }

    .content {
        color: rgb(96, 98, 102);
        line-height: 26px;
    }
}
</style>
